﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CLab.Common.Objects;

namespace CLab.Utils.Extensions
{
    public static class ListExtension
    {
        //public static List<T> Clone<T>(this List<T> listToClone) where T : ICloneable
        //{
        //    return listToClone.Select(item => (T)item.Clone()).ToList();
        //}

        public static List<Parametro> CloneParametros(this List<Parametro> listToClone)
        {
            var newList = new List<Parametro>(listToClone.Count);

            listToClone.ForEach((item) => newList.Add(new Parametro(item.Acceso, item.Nombre, item.Valor)));

            return newList;
        }
    }
}